using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace Adex
{
	/// <summary>
	/// Strongly-typed collection for the NewsLog class.
	/// </summary>
	[Serializable]
	public partial class NewsLogCollection : ActiveList<NewsLog, NewsLogCollection> 
	{	   
		public NewsLogCollection() {}

	}

	/// <summary>
	/// This is an ActiveRecord class which wraps the NewsLog table.
	/// </summary>
	[Serializable]
	public partial class NewsLog : ActiveRecord<NewsLog>
	{
		#region .ctors and Default Settings
		
		public NewsLog()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}

		
		private void InitSetDefaults() { SetDefaults(); }

		
		public NewsLog(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}

		public NewsLog(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}

		 
		public NewsLog(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}

		
		protected static void SetSQLProps() { GetTableSchema(); }

		
		#endregion
		
		#region Schema and Query Accessor
		public static Query CreateQuery() { return new Query(Schema); }

		
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}

		}

		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("NewsLog", TableType.Table, DataService.GetInstance("Adex"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarNewsLogID = new TableSchema.TableColumn(schema);
				colvarNewsLogID.ColumnName = "NewsLogID";
				colvarNewsLogID.DataType = DbType.Int32;
				colvarNewsLogID.MaxLength = 0;
				colvarNewsLogID.AutoIncrement = true;
				colvarNewsLogID.IsNullable = false;
				colvarNewsLogID.IsPrimaryKey = true;
				colvarNewsLogID.IsForeignKey = false;
				colvarNewsLogID.IsReadOnly = false;
				colvarNewsLogID.DefaultSetting = @"";
				colvarNewsLogID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNewsLogID);
				
				TableSchema.TableColumn colvarCountryID = new TableSchema.TableColumn(schema);
				colvarCountryID.ColumnName = "CountryID";
				colvarCountryID.DataType = DbType.Byte;
				colvarCountryID.MaxLength = 0;
				colvarCountryID.AutoIncrement = false;
				colvarCountryID.IsNullable = true;
				colvarCountryID.IsPrimaryKey = false;
				colvarCountryID.IsForeignKey = false;
				colvarCountryID.IsReadOnly = false;
				colvarCountryID.DefaultSetting = @"";
				colvarCountryID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCountryID);
				
				TableSchema.TableColumn colvarRFDate = new TableSchema.TableColumn(schema);
				colvarRFDate.ColumnName = "RFDate";
				colvarRFDate.DataType = DbType.DateTime;
				colvarRFDate.MaxLength = 0;
				colvarRFDate.AutoIncrement = false;
				colvarRFDate.IsNullable = false;
				colvarRFDate.IsPrimaryKey = false;
				colvarRFDate.IsForeignKey = false;
				colvarRFDate.IsReadOnly = false;
				colvarRFDate.DefaultSetting = @"";
				colvarRFDate.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRFDate);
				
				TableSchema.TableColumn colvarMediaType = new TableSchema.TableColumn(schema);
				colvarMediaType.ColumnName = "MediaTypeCode";
				colvarMediaType.DataType = DbType.Byte;
				colvarMediaType.MaxLength = 0;
				colvarMediaType.AutoIncrement = false;
				colvarMediaType.IsNullable = true;
				colvarMediaType.IsPrimaryKey = false;
				colvarMediaType.IsForeignKey = false;
				colvarMediaType.IsReadOnly = false;
				colvarMediaType.DefaultSetting = @"";
				colvarMediaType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarMediaType);
				
				TableSchema.TableColumn colvarMediaCode = new TableSchema.TableColumn(schema);
				colvarMediaCode.ColumnName = "MediaCode";
				colvarMediaCode.DataType = DbType.Int32;
				colvarMediaCode.MaxLength = 0;
				colvarMediaCode.AutoIncrement = false;
				colvarMediaCode.IsNullable = true;
				colvarMediaCode.IsPrimaryKey = false;
				colvarMediaCode.IsForeignKey = true;
				colvarMediaCode.IsReadOnly = false;
				colvarMediaCode.DefaultSetting = @"";
				
					colvarMediaCode.ForeignKeyTableName = "Medium";
				schema.Columns.Add(colvarMediaCode);
				
				TableSchema.TableColumn colvarNewsTitle = new TableSchema.TableColumn(schema);
				colvarNewsTitle.ColumnName = "NewsTitle";
				colvarNewsTitle.DataType = DbType.String;
				colvarNewsTitle.MaxLength = 300;
				colvarNewsTitle.AutoIncrement = false;
				colvarNewsTitle.IsNullable = true;
				colvarNewsTitle.IsPrimaryKey = false;
				colvarNewsTitle.IsForeignKey = false;
				colvarNewsTitle.IsReadOnly = false;
				colvarNewsTitle.DefaultSetting = @"";
				colvarNewsTitle.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNewsTitle);
				
				TableSchema.TableColumn colvarNewsType = new TableSchema.TableColumn(schema);
				colvarNewsType.ColumnName = "NewsTypeCode";
				colvarNewsType.DataType = DbType.Byte;
				colvarNewsType.MaxLength = 0;
				colvarNewsType.AutoIncrement = false;
				colvarNewsType.IsNullable = true;
				colvarNewsType.IsPrimaryKey = false;
				colvarNewsType.IsForeignKey = false;
				colvarNewsType.IsReadOnly = false;
				colvarNewsType.DefaultSetting = @"";
				colvarNewsType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNewsType);
				
				TableSchema.TableColumn colvarNewsTypeName = new TableSchema.TableColumn(schema);
				colvarNewsTypeName.ColumnName = "NewsTypeName";
				colvarNewsTypeName.DataType = DbType.String;
				colvarNewsTypeName.MaxLength = 100;
				colvarNewsTypeName.AutoIncrement = false;
				colvarNewsTypeName.IsNullable = true;
				colvarNewsTypeName.IsPrimaryKey = false;
				colvarNewsTypeName.IsForeignKey = false;
				colvarNewsTypeName.IsReadOnly = false;
				colvarNewsTypeName.DefaultSetting = @"";
				colvarNewsTypeName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNewsTypeName);
				
				TableSchema.TableColumn colvarPageNumber = new TableSchema.TableColumn(schema);
				colvarPageNumber.ColumnName = "PageNumber";
				colvarPageNumber.DataType = DbType.Int32;
				colvarPageNumber.MaxLength = 0;
				colvarPageNumber.AutoIncrement = false;
				colvarPageNumber.IsNullable = true;
				colvarPageNumber.IsPrimaryKey = false;
				colvarPageNumber.IsForeignKey = false;
				colvarPageNumber.IsReadOnly = false;
				colvarPageNumber.DefaultSetting = @"";
				colvarPageNumber.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPageNumber);
				
				TableSchema.TableColumn colvarColumnSize = new TableSchema.TableColumn(schema);
				colvarColumnSize.ColumnName = "ColumnSize";
				colvarColumnSize.DataType = DbType.Int32;
				colvarColumnSize.MaxLength = 0;
				colvarColumnSize.AutoIncrement = false;
				colvarColumnSize.IsNullable = true;
				colvarColumnSize.IsPrimaryKey = false;
				colvarColumnSize.IsForeignKey = false;
				colvarColumnSize.IsReadOnly = false;
				colvarColumnSize.DefaultSetting = @"";
				colvarColumnSize.ForeignKeyTableName = "";
				schema.Columns.Add(colvarColumnSize);
				
				TableSchema.TableColumn colvarInchesSize = new TableSchema.TableColumn(schema);
				colvarInchesSize.ColumnName = "InchesSize";
				colvarInchesSize.DataType = DbType.Int32;
				colvarInchesSize.MaxLength = 0;
				colvarInchesSize.AutoIncrement = false;
				colvarInchesSize.IsNullable = true;
				colvarInchesSize.IsPrimaryKey = false;
				colvarInchesSize.IsForeignKey = false;
				colvarInchesSize.IsReadOnly = false;
				colvarInchesSize.DefaultSetting = @"";
				colvarInchesSize.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInchesSize);
				
				TableSchema.TableColumn colvarRealCost = new TableSchema.TableColumn(schema);
				colvarRealCost.ColumnName = "RealCost";
				colvarRealCost.DataType = DbType.Currency;
				colvarRealCost.MaxLength = 0;
				colvarRealCost.AutoIncrement = false;
				colvarRealCost.IsNullable = true;
				colvarRealCost.IsPrimaryKey = false;
				colvarRealCost.IsForeignKey = false;
				colvarRealCost.IsReadOnly = false;
				colvarRealCost.DefaultSetting = @"";
				colvarRealCost.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRealCost);
				
				TableSchema.TableColumn colvarSectionCode = new TableSchema.TableColumn(schema);
				colvarSectionCode.ColumnName = "SectionCode";
				colvarSectionCode.DataType = DbType.Int32;
				colvarSectionCode.MaxLength = 0;
				colvarSectionCode.AutoIncrement = false;
				colvarSectionCode.IsNullable = true;
				colvarSectionCode.IsPrimaryKey = false;
				colvarSectionCode.IsForeignKey = false;
				colvarSectionCode.IsReadOnly = false;
				colvarSectionCode.DefaultSetting = @"";
				colvarSectionCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSectionCode);
				
				TableSchema.TableColumn colvarProductID = new TableSchema.TableColumn(schema);
				colvarProductID.ColumnName = "ProductID";
				colvarProductID.DataType = DbType.Int32;
				colvarProductID.MaxLength = 0;
				colvarProductID.AutoIncrement = false;
				colvarProductID.IsNullable = true;
				colvarProductID.IsPrimaryKey = false;
				colvarProductID.IsForeignKey = false;
				colvarProductID.IsReadOnly = false;
				colvarProductID.DefaultSetting = @"";
				colvarProductID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProductID);
				
				TableSchema.TableColumn colvarCategoryID = new TableSchema.TableColumn(schema);
				colvarCategoryID.ColumnName = "CategoryID";
				colvarCategoryID.DataType = DbType.Int32;
				colvarCategoryID.MaxLength = 0;
				colvarCategoryID.AutoIncrement = false;
				colvarCategoryID.IsNullable = true;
				colvarCategoryID.IsPrimaryKey = false;
				colvarCategoryID.IsForeignKey = false;
				colvarCategoryID.IsReadOnly = false;
				colvarCategoryID.DefaultSetting = @"";
				colvarCategoryID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCategoryID);
				
				TableSchema.TableColumn colvarSubSectorID = new TableSchema.TableColumn(schema);
				colvarSubSectorID.ColumnName = "SubSectorID";
				colvarSubSectorID.DataType = DbType.Int32;
				colvarSubSectorID.MaxLength = 0;
				colvarSubSectorID.AutoIncrement = false;
				colvarSubSectorID.IsNullable = true;
				colvarSubSectorID.IsPrimaryKey = false;
				colvarSubSectorID.IsForeignKey = false;
				colvarSubSectorID.IsReadOnly = false;
				colvarSubSectorID.DefaultSetting = @"";
				colvarSubSectorID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSubSectorID);
				
				TableSchema.TableColumn colvarSectorID = new TableSchema.TableColumn(schema);
				colvarSectorID.ColumnName = "SectorID";
				colvarSectorID.DataType = DbType.Int32;
				colvarSectorID.MaxLength = 0;
				colvarSectorID.AutoIncrement = false;
				colvarSectorID.IsNullable = true;
				colvarSectorID.IsPrimaryKey = false;
				colvarSectorID.IsForeignKey = false;
				colvarSectorID.IsReadOnly = false;
				colvarSectorID.DefaultSetting = @"";
				colvarSectorID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSectorID);
				
				TableSchema.TableColumn colvarNewsLink = new TableSchema.TableColumn(schema);
				colvarNewsLink.ColumnName = "NewsLink";
				colvarNewsLink.DataType = DbType.String;
				colvarNewsLink.MaxLength = 300;
				colvarNewsLink.AutoIncrement = false;
				colvarNewsLink.IsNullable = true;
				colvarNewsLink.IsPrimaryKey = false;
				colvarNewsLink.IsForeignKey = false;
				colvarNewsLink.IsReadOnly = false;
				colvarNewsLink.DefaultSetting = @"";
				colvarNewsLink.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNewsLink);
				
				TableSchema.TableColumn colvarNewsMediaType = new TableSchema.TableColumn(schema);
				colvarNewsMediaType.ColumnName = "NewsMediaType";
				colvarNewsMediaType.DataType = DbType.String;
				colvarNewsMediaType.MaxLength = 100;
				colvarNewsMediaType.AutoIncrement = false;
				colvarNewsMediaType.IsNullable = true;
				colvarNewsMediaType.IsPrimaryKey = false;
				colvarNewsMediaType.IsForeignKey = false;
				colvarNewsMediaType.IsReadOnly = false;
				colvarNewsMediaType.DefaultSetting = @"";
				colvarNewsMediaType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarNewsMediaType);
				
				TableSchema.TableColumn colvarCropPicture = new TableSchema.TableColumn(schema);
				colvarCropPicture.ColumnName = "CropPicture";
				colvarCropPicture.DataType = DbType.String;
				colvarCropPicture.MaxLength = 50;
				colvarCropPicture.AutoIncrement = false;
				colvarCropPicture.IsNullable = true;
				colvarCropPicture.IsPrimaryKey = false;
				colvarCropPicture.IsForeignKey = false;
				colvarCropPicture.IsReadOnly = false;
				colvarCropPicture.DefaultSetting = @"";
				colvarCropPicture.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCropPicture);
				
				TableSchema.TableColumn colvarFullPagePicture = new TableSchema.TableColumn(schema);
				colvarFullPagePicture.ColumnName = "FullPagePicture";
				colvarFullPagePicture.DataType = DbType.String;
				colvarFullPagePicture.MaxLength = 50;
				colvarFullPagePicture.AutoIncrement = false;
				colvarFullPagePicture.IsNullable = true;
				colvarFullPagePicture.IsPrimaryKey = false;
				colvarFullPagePicture.IsForeignKey = false;
				colvarFullPagePicture.IsReadOnly = false;
				colvarFullPagePicture.DefaultSetting = @"";
				colvarFullPagePicture.ForeignKeyTableName = "";
				schema.Columns.Add(colvarFullPagePicture);
				
				TableSchema.TableColumn colvarPDFName = new TableSchema.TableColumn(schema);
				colvarPDFName.ColumnName = "PDFName";
				colvarPDFName.DataType = DbType.String;
				colvarPDFName.MaxLength = 50;
				colvarPDFName.AutoIncrement = false;
				colvarPDFName.IsNullable = true;
				colvarPDFName.IsPrimaryKey = false;
				colvarPDFName.IsForeignKey = false;
				colvarPDFName.IsReadOnly = false;
				colvarPDFName.DefaultSetting = @"";
				colvarPDFName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPDFName);
				
				TableSchema.TableColumn colvarDateAdded = new TableSchema.TableColumn(schema);
				colvarDateAdded.ColumnName = "DateAdded";
				colvarDateAdded.DataType = DbType.DateTime;
				colvarDateAdded.MaxLength = 0;
				colvarDateAdded.AutoIncrement = false;
				colvarDateAdded.IsNullable = false;
				colvarDateAdded.IsPrimaryKey = false;
				colvarDateAdded.IsForeignKey = false;
				colvarDateAdded.IsReadOnly = false;
				colvarDateAdded.DefaultSetting = @"";
				colvarDateAdded.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAdded);
				
				TableSchema.TableColumn colvarDateModified = new TableSchema.TableColumn(schema);
				colvarDateModified.ColumnName = "DateModified";
				colvarDateModified.DataType = DbType.DateTime;
				colvarDateModified.MaxLength = 0;
				colvarDateModified.AutoIncrement = false;
				colvarDateModified.IsNullable = false;
				colvarDateModified.IsPrimaryKey = false;
				colvarDateModified.IsForeignKey = false;
				colvarDateModified.IsReadOnly = false;
				colvarDateModified.DefaultSetting = @"";
				colvarDateModified.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateModified);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["Adex"].AddSchema("NewsLog",schema);
			}

		}

		#endregion
		
		#region Props
		
		  
		[XmlAttribute("NewsLogID")]
		public int NewsLogID 
		{
			get { return GetColumnValue<int>("NewsLogID"); }

			set { SetColumnValue("NewsLogID", value); }

		}

		  
		[XmlAttribute("CountryID")]
		public byte? CountryID 
		{
			get { return GetColumnValue<byte?>("CountryID"); }

			set { SetColumnValue("CountryID", value); }

		}

		  
		[XmlAttribute("RFDate")]
		public DateTime RFDate 
		{
			get { return GetColumnValue<DateTime>("RFDate"); }

			set { SetColumnValue("RFDate", value); }

		}

		  
		[XmlAttribute("MediaType")]
		public byte? MediaType 
		{
			get { return GetColumnValue<byte?>("MediaTypeCode"); }

			set { SetColumnValue("MediaTypeCode", value); }

		}

		  
		[XmlAttribute("MediaCode")]
		public int? MediaCode 
		{
			get { return GetColumnValue<int?>("MediaCode"); }

			set { SetColumnValue("MediaCode", value); }

		}

		  
		[XmlAttribute("NewsTitle")]
		public string NewsTitle 
		{
			get { return GetColumnValue<string>("NewsTitle"); }

			set { SetColumnValue("NewsTitle", value); }

		}

		  
		[XmlAttribute("NewsType")]
		public byte? NewsType 
		{
			get { return GetColumnValue<byte?>("NewsTypeCode"); }

			set { SetColumnValue("NewsTypeCode", value); }

		}

		  
		[XmlAttribute("NewsTypeName")]
		public string NewsTypeName 
		{
			get { return GetColumnValue<string>("NewsTypeName"); }

			set { SetColumnValue("NewsTypeName", value); }

		}

		  
		[XmlAttribute("PageNumber")]
		public int? PageNumber 
		{
			get { return GetColumnValue<int?>("PageNumber"); }

			set { SetColumnValue("PageNumber", value); }

		}

		  
		[XmlAttribute("ColumnSize")]
		public int? ColumnSize 
		{
			get { return GetColumnValue<int?>("ColumnSize"); }

			set { SetColumnValue("ColumnSize", value); }

		}

		  
		[XmlAttribute("InchesSize")]
		public int? InchesSize 
		{
			get { return GetColumnValue<int?>("InchesSize"); }

			set { SetColumnValue("InchesSize", value); }

		}

		  
		[XmlAttribute("RealCost")]
		public decimal? RealCost 
		{
			get { return GetColumnValue<decimal?>("RealCost"); }

			set { SetColumnValue("RealCost", value); }

		}

		  
		[XmlAttribute("SectionCode")]
		public int? SectionCode 
		{
			get { return GetColumnValue<int?>("SectionCode"); }

			set { SetColumnValue("SectionCode", value); }

		}

		  
		[XmlAttribute("ProductID")]
		public int? ProductID 
		{
			get { return GetColumnValue<int?>("ProductID"); }

			set { SetColumnValue("ProductID", value); }

		}

		  
		[XmlAttribute("CategoryID")]
		public int? CategoryID 
		{
			get { return GetColumnValue<int?>("CategoryID"); }

			set { SetColumnValue("CategoryID", value); }

		}

		  
		[XmlAttribute("SubSectorID")]
		public int? SubSectorID 
		{
			get { return GetColumnValue<int?>("SubSectorID"); }

			set { SetColumnValue("SubSectorID", value); }

		}

		  
		[XmlAttribute("SectorID")]
		public int? SectorID 
		{
			get { return GetColumnValue<int?>("SectorID"); }

			set { SetColumnValue("SectorID", value); }

		}

		  
		[XmlAttribute("NewsLink")]
		public string NewsLink 
		{
			get { return GetColumnValue<string>("NewsLink"); }

			set { SetColumnValue("NewsLink", value); }

		}

		  
		[XmlAttribute("NewsMediaType")]
		public string NewsMediaType 
		{
			get { return GetColumnValue<string>("NewsMediaType"); }

			set { SetColumnValue("NewsMediaType", value); }

		}

		  
		[XmlAttribute("CropPicture")]
		public string CropPicture 
		{
			get { return GetColumnValue<string>("CropPicture"); }

			set { SetColumnValue("CropPicture", value); }

		}

		  
		[XmlAttribute("FullPagePicture")]
		public string FullPagePicture 
		{
			get { return GetColumnValue<string>("FullPagePicture"); }

			set { SetColumnValue("FullPagePicture", value); }

		}

		  
		[XmlAttribute("PDFName")]
		public string PDFName 
		{
			get { return GetColumnValue<string>("PDFName"); }

			set { SetColumnValue("PDFName", value); }

		}

		  
		[XmlAttribute("DateAdded")]
		public DateTime DateAdded 
		{
			get { return GetColumnValue<DateTime>("DateAdded"); }

			set { SetColumnValue("DateAdded", value); }

		}

		  
		[XmlAttribute("DateModified")]
		public DateTime DateModified 
		{
			get { return GetColumnValue<DateTime>("DateModified"); }

			set { SetColumnValue("DateModified", value); }

		}

		
		#endregion
		
		
			
		
		#region ForeignKey Properties
		
		/// <summary>
		/// Returns a Medium ActiveRecord object related to this NewsLog
		/// 
		/// </summary>
		public Adex.Medium Medium
		{
			get { return Adex.Medium.FetchByID(this.MediaCode); }

			set { SetColumnValue("MediaCode", value.MediaCode); }

		}

		
		
		#endregion
		
		
		
		//no ManyToMany tables defined (0)
		
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(byte? varCountryID,DateTime varRFDate,byte? varMediaType,int? varMediaCode,string varNewsTitle,byte? varNewsType,string varNewsTypeName,int? varPageNumber,int? varColumnSize,int? varInchesSize,decimal? varRealCost,int? varSectionCode,int? varProductID,int? varCategoryID,int? varSubSectorID,int? varSectorID,string varNewsLink,string varNewsMediaType,string varCropPicture,string varFullPagePicture,string varPDFName,DateTime varDateAdded,DateTime varDateModified)
		{
			NewsLog item = new NewsLog();
			
			item.CountryID = varCountryID;
			
			item.RFDate = varRFDate;
			
			item.MediaType = varMediaType;
			
			item.MediaCode = varMediaCode;
			
			item.NewsTitle = varNewsTitle;
			
			item.NewsType = varNewsType;
			
			item.NewsTypeName = varNewsTypeName;
			
			item.PageNumber = varPageNumber;
			
			item.ColumnSize = varColumnSize;
			
			item.InchesSize = varInchesSize;
			
			item.RealCost = varRealCost;
			
			item.SectionCode = varSectionCode;
			
			item.ProductID = varProductID;
			
			item.CategoryID = varCategoryID;
			
			item.SubSectorID = varSubSectorID;
			
			item.SectorID = varSectorID;
			
			item.NewsLink = varNewsLink;
			
			item.NewsMediaType = varNewsMediaType;
			
			item.CropPicture = varCropPicture;
			
			item.FullPagePicture = varFullPagePicture;
			
			item.PDFName = varPDFName;
			
			item.DateAdded = varDateAdded;
			
			item.DateModified = varDateModified;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varNewsLogID,byte? varCountryID,DateTime varRFDate,byte? varMediaType,int? varMediaCode,string varNewsTitle,byte? varNewsType,string varNewsTypeName,int? varPageNumber,int? varColumnSize,int? varInchesSize,decimal? varRealCost,int? varSectionCode,int? varProductID,int? varCategoryID,int? varSubSectorID,int? varSectorID,string varNewsLink,string varNewsMediaType,string varCropPicture,string varFullPagePicture,string varPDFName,DateTime varDateAdded,DateTime varDateModified)
		{
			NewsLog item = new NewsLog();
			
				item.NewsLogID = varNewsLogID;
				
				item.CountryID = varCountryID;
				
				item.RFDate = varRFDate;
				
				item.MediaType = varMediaType;
				
				item.MediaCode = varMediaCode;
				
				item.NewsTitle = varNewsTitle;
				
				item.NewsType = varNewsType;
				
				item.NewsTypeName = varNewsTypeName;
				
				item.PageNumber = varPageNumber;
				
				item.ColumnSize = varColumnSize;
				
				item.InchesSize = varInchesSize;
				
				item.RealCost = varRealCost;
				
				item.SectionCode = varSectionCode;
				
				item.ProductID = varProductID;
				
				item.CategoryID = varCategoryID;
				
				item.SubSectorID = varSubSectorID;
				
				item.SectorID = varSectorID;
				
				item.NewsLink = varNewsLink;
				
				item.NewsMediaType = varNewsMediaType;
				
				item.CropPicture = varCropPicture;
				
				item.FullPagePicture = varFullPagePicture;
				
				item.PDFName = varPDFName;
				
				item.DateAdded = varDateAdded;
				
				item.DateModified = varDateModified;
				
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		#endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string NewsLogID = @"NewsLogID";
			 public static string CountryID = @"CountryID";
			 public static string RFDate = @"RFDate";
			 public static string MediaType = @"MediaTypeCode";
			 public static string MediaCode = @"MediaCode";
			 public static string NewsTitle = @"NewsTitle";
			 public static string NewsType = @"NewsTypeCode";
			 public static string NewsTypeName = @"NewsTypeName";
			 public static string PageNumber = @"PageNumber";
			 public static string ColumnSize = @"ColumnSize";
			 public static string InchesSize = @"InchesSize";
			 public static string RealCost = @"RealCost";
			 public static string SectionCode = @"SectionCode";
			 public static string ProductID = @"ProductID";
			 public static string CategoryID = @"CategoryID";
			 public static string SubSectorID = @"SubSectorID";
			 public static string SectorID = @"SectorID";
			 public static string NewsLink = @"NewsLink";
			 public static string NewsMediaType = @"NewsMediaType";
			 public static string CropPicture = @"CropPicture";
			 public static string FullPagePicture = @"FullPagePicture";
			 public static string PDFName = @"PDFName";
			 public static string DateAdded = @"DateAdded";
			 public static string DateModified = @"DateModified";
						
		}

		#endregion
	}

}

